<?php
function smarty_function_combinedinput($params, $smarty) {
    $template = "combinedinput.tpl";
    $required = 0;
    $inputs = array();

    $names = explode(",", $params['fields']);
    $values = explode(",", $params['values']);
    $titles = explode(",", $params['titles']);
    for ($i = 0; $i < count($names); $i++) {
        $inputs[] = array(
            name => $names[$i],
            value => $values[$i],
            title => $titles[$i],
        );
    }
    foreach ($params as $key=>$value) {
        if ($key == "required") { $required = $value; }
    }
    $smarty->assign("inputs", $inputs);
    $smarty->assign("required", $required);
    return $smarty->fetch("plugins/$template");
}

?>
